package org.example.authentication.server;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
@Tag(name = "test")
public class TestController {
    @GetMapping("/")
    @Operation(description = "测试")
    public Object test(OAuth2AuthorizationService authorizationService) {

        return SecurityContextHolder.getContext().getAuthentication();
    }
}
